$(function(){
    //轮播图
    banner()
    function banner(){
        let imgs = document.querySelectorAll('.box .seboxs img');
        console.log(imgs);
        let btns = document.querySelectorAll('.cli label');
        let imgsbox = document.querySelector('.Rotation .box .seboxs');
        console.log(imgsbox)
        let num=0
        function move(i) {
            imgsbox.style.marginLeft= -100* i +'%'
        }
        let set = setInterval(auto,3000)
        
        function auto() {
            if(num >= imgs.length - 1) {
                num = -1
            }
            num++
            move(num)
            color(num)
        }
        function color(e) {
            for(let i = 0;i<btns.length;i++) {
                if(e == i){
                    btns[i].classList.add('active')
                }else{
                    btns[i].classList.remove('active')
                }
            }
        }
        function btn() {
            for (let i = 0;i<btns.length;i++){
                btns[i].onclick=(()=>{
                    clearInterval(set)
                    set = setInterval(auto,4000)
                    move(i)
                    color(i)
                })
            }
        }
        btn()
    }
})